using System;

namespace Game.Level
{
    public class GameLevelEvents
    {
        public event EventHandler<LevelEventArgs> LevelAdded;
        public event EventHandler<LevelEventArgs> LevelRemoved;
        public event EventHandler<LevelEventArgs> LevelUpdated;

        public event EventHandler<LevelEventArgs> LevelActive;
        public event EventHandler GameEnded;
        public event EventHandler GameRestart;
        public event EventHandler GameSuccess;
        public event EventHandler GameFailure;

        public void FireGameEnded()
        {
            if (GameEnded != null)
            {
                GameEnded(this, new EventArgs());
            }
        }

        public void FireGameRestart()
        {
            if (GameRestart != null)
            {
                GameRestart(this, new EventArgs());
            }
        }

        public void FireLevelActive(GameLevel level)
        {
            if (LevelActive != null)
            {
                LevelActive(this, new LevelEventArgs { GameLevel = level });
            }
        }

        public void FireLevelAdded(GameLevel level)
        {
            if (LevelAdded != null)
            {
                LevelAdded(this, new LevelEventArgs { GameLevel = level });
            }
        }

        public void FireLevelRemoved(GameLevel level)
        {
            if (LevelRemoved != null)
            {
                LevelRemoved(this, new LevelEventArgs { GameLevel = level });
            }
        }

        public void FireLevelUpdated(GameLevel level)
        {
            if (LevelUpdated != null)
            {
                LevelUpdated(this, new LevelEventArgs { GameLevel = level });
            }
        }

        public void FireGameSuccess()
        {
            if (GameSuccess != null)
            {
                GameSuccess(this, new EventArgs());
            }
        }

        public void FireGameFailure()
        {
            if (GameFailure != null)
            {
                GameFailure(this, new EventArgs());
            }
        }

    }
}